import service from '@/utils/request'

const BASE_URL = 'api-system'

//获取精选列表
export function selectCourseList(data) {
    return service({
        url: `${BASE_URL}/select-courses`,
        method: 'get',
        params: data
    })
}

// 新增精选课程
export function addSelectCourse(data) {
    return service({
        url: `${BASE_URL}/select-course`,
        method: 'post',
        data
    })
}

// 修改精选课程
export function updateSelectCourse(data) {
    return service({
        url: `${BASE_URL}/select-course`,
        method: 'put',
        data
    })
}

//获取精选课程
export function getSelectCourse(selectCourseId) {
    return service({
        url: `${BASE_URL}/select-course/${selectCourseId}`,
        method: 'get'
    })
}

//删除精选课程
export function deleteSelectCourse(selectCourseId) {
    return service({
        url: `${BASE_URL}/select-course/${selectCourseId}`,
        method: 'delete'
    })
}

//修改精选课程状态
export function updateSelectCourseStatus(selectCourseId,status) {
    return service({
        url: `${BASE_URL}/select-course/${selectCourseId}/status/${status}`,
        method: 'put'
    })
}
